background-gradient-end: rgba(255, 255, 255, 0.2);
}
+.notification-icon-button:insensitive,
+.notification-button:insensitive {
+ color: #9f9f9f;
+}
+
/* Panel */
#panel {
}
let button = new St.Button({ can_focus: true });
+ button._actionId = id;
if (this._useActionIcons && Gtk.IconTheme.get_default().has_icon(id)) {
button.add_style_class_name('notification-icon-button');
this.updated();
},
+ // setButtonSensitive:
+ // @id: the action ID
+ // @sensitive: whether the button should be sensitive
+ //
+ // If the notification contains a button with action ID @id,
+ // its sensitivity will be set to @sensitive. Insensitive
+ // buttons cannot be clicked.
+ setButtonSensitive: function(id, sensitive) {
+ if (!this._buttonBox)
+ return;
+
+ let button = this._buttonBox.get_children().filter(function(b) {
+ return b._actionId == id;
+ })[0];
+
+ if (!button || button.reactive == sensitive)
+ return;
+
+ button.reactive = sensitive;
+ if (sensitive)
+ button.remove_style_pseudo_class('insensitive');
+ else
+ button.add_style_pseudo_class('insensitive');
+ },
+
setUrgency: function(urgency) {
this.urgency = urgency;
},